import { createRouter, createWebHistory } from "vue-router";
import IndexPage from "@/views/index.vue";
import reactive from "@/views/reactive.vue";
import reactiveAPI from "@/views/reactiveAPI.vue";
import watch from "@/views/watch.vue";
import asyncComponent from "@/views/asyncComponent.vue";
const routes = [
  {
    path: "/",
    component: IndexPage,
  },
  {
    path: "/index",
    component: IndexPage,
  },
  {
    path: "/reactive",
    component: reactive,
  },
  {
    path: "/reactiveAPI",
    component: reactiveAPI,
  },
  {
    path: "/watch",
    component: watch,
  },
  {
    path: "/asyncComponent",
    component: asyncComponent,
  },
];

const router = createRouter({
  routes,
  history: createWebHistory(), // 使用历史模式
});

export default router;
